<template>
  <el-col
    :span="widget.options.span"
    :offset="widget.options.offset"
    :push="widget.options.push"
    :pull="widget.options.pull"
    :tag="widget.options.tag ? widget.options.tag : 'div'"
    @click.stop="selectField"
  >
    <slot></slot>
    <draggable-list :widget="widget"></draggable-list>
  </el-col>
</template>

<script setup>
import { assignmentWidget } from "@/views/pageDesign/components/globalVariable";
import draggableList from "@/components/draggableList";

defineOptions({
  name: "colWidget",
  inheritAttrs: false,
});

let $props = defineProps({
  widget: {
    type: Object,
    required: true,
  },
});

let selectField = () => {
  assignmentWidget($props.widget);
};
</script>

<style lang="scss" scoped>
.el-col {
  padding: 2px;
  // margin: 5px 10px;
  border: 1px dashed rgba(170, 170, 170, 0.75);
  min-height: 50px;
}
</style>
